package com.heima.article.controller.v1;
import com.heima.article.service.ApArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "App端文章API",tags = "App端文章API")
@RestController
@RequestMapping("/api/v1/article")
public class ApArticleController {
    @Autowired
     ApArticleService apArticleService;
    //基于ArticleDto 保存文章信息 文章详情信息 文章配置信息,最后将生成的文章id返回

    @ApiOperation(value = "保存App端文章信息",notes = "基于ArticleDto 保存文章信息 文章详情信息 文章配置信息,最后将生成的文章id返回")
    @PostMapping("/save")
    public ResponseResult saveArticle(@RequestBody ArticleDto articleDto) {
        return apArticleService.saveApArticle(articleDto);
    }
}